package cn.tedu.dog;

import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

// 组件扫描保存到Spring容器!!!
@Component
//@Lazy
public class Dog {

    private String name;
    private String color;
    private Integer age;

    //创建一个无参构造方法
    public Dog(){
        // 无参构造方法运行输出信息
        System.out.println("Dog构造方法执行");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Dog{" +
                "name='" + name + '\'' +
                ", color='" + color + '\'' +
                ", age=" + age +
                '}';
    }
}
